package com.lz.zk.example.swagger;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.lz.zk.regex.Parser;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@RestController
@RequestMapping("/user")
@Api(value = "用户信息管理")
public class SwaggerExampleController {
	
	@Autowired
	Parser parser;
	
		@ApiOperation(value = "获取用户信息", notes = "通过用户ID获取用户信息", httpMethod = "GET")
	 	@RequestMapping(method = RequestMethod.GET,value = "/userById")
	    public int findById(@ApiParam(value = "用户ID",required = true) int id){
	        return id;
	    }
	 
	    @ApiOperation(value = "获取用户信息", notes = "通过用户姓名获取用户信息", httpMethod = "POST")
	    @RequestMapping(method = RequestMethod.POST,value = "/userByName")
	    public String findByName(@ApiParam(value = "用户姓名",required = true) String  name){
		return name; 
	    }

}
